<?php
	$dtype_id = $params[0];
	if($_SERVER["REQUEST_METHOD"]=='POST') {
		$dtype_id		= $_POST['dtype_id'];
		$title			= $_POST['title'];
		$remark			= $_POST['remark'];
		
		$sql = "UPDATE `tbl_discount_type` SET `title` = '$title', `remark` = '$remark' WHERE  `dtype_id` = '$dtype_id';";
		
		mysql_query($sql);
		redirect('../../discount/');
		exit;
	}

	$sql = "SELECT title,remark,dtype_id FROM `tbl_discount_type` WHERE  `dtype_id` = '$dtype_id'";
	$query = mysql_query($sql);
	$title = mysql_result($query,0,0);
	$remark = mysql_result($query,0,1);
	$dtype_id = mysql_result($query,0,2);
	
	mysql_free_result($query);
?>